import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import NotFound from './views/NotFound.vue'
/* 引入首页组件 */
import Homepage from './views/Homepage.vue'
import Personalcenter from './views/Personalcenter.vue'
import Thelogin from './views/Thelogin.vue'
/* 引入二级路由 */
import Recommend from './views/Second/Recommend.vue'
import Ranking from './views/Second/Ranking.vue'
import SongList from './views/Second/SongList.vue'
/* 引入三级路由 */
import Zhuyuanzhang from './views/Second/Third/Zhuyuanzhang.vue'
import YingZhen from './views/Second/Third/YingZhen.vue'
Vue.use(VueRouter)
/* 配置路由规则 */
let routes=[
  {
    path: '/',
    redirect:'/Homepage'
  },
  {
    name: 'Homepage',
    path: '/homepage',
    component: Homepage,
    children: [
      {
        name: 'Recommend',
        path: 'recommend',
        component: Recommend,
        children: [
          {
            path:'zhuyuanzhang',
            component:Zhuyuanzhang
          },
          {
            path:'yingzhen',
            component:YingZhen
          }
        ]
      },
      {
        name: 'Ranking',
        path: 'ranking',
        component: Ranking
      },
      {
        name: 'SongList',
        path: 'songList',
        component: SongList
      },
    ]
  },
  {
    name: 'Personalcenter',
    path: '/personalcenter',
    component: Personalcenter
  },
  {
    name: 'Thelogin',
    path: '/thelogin',
    component: Thelogin
  },

  {
    path: '*',
    component: NotFound
  }
]

let router = new VueRouter({
  routes,
  // 设置路由模式, 取值范围: hash / history
  // hash: 带井号的路径
  // history: 不带#号的路径, 但是需要后端配合
  mode: 'history'
})






Vue.config.productionTip = false

new Vue({
  
  render: h => h(App),
  router
}).$mount('#app')
